package jxerializeml.examples.game_config;

import java.io.IOException;

import jxerializeml.errors.JXerializeMLError;
import jxerializeml.examples.game_config.beans.ConfigurationBean;

public class Main {
	public static void main(String[] args) throws JXerializeMLError, IOException {
		ConfigurationBean configurationBean = ConfigurationBean.load("res/config.xml");
		
		System.out.printf("Sounds: \n");
		System.out.printf("  Music volume: %d\n", configurationBean.getSounds().getVolumeMusic());
		System.out.printf("  Sounds volume: %d\n", configurationBean.getSounds().getVolumeSounds());
		System.out.printf("Graphics: \n");
		System.out.printf("  Window width: %d\n", configurationBean.getGraphics().getWindowWidth());
		System.out.printf("  Window height: %d\n", configurationBean.getGraphics().getWindowHeight());
		System.out.printf("  Texture pack: %s\n", configurationBean.getGraphics().getTexturePack());
		
		configurationBean.save("res/config.xml");
	}
}
